require("../../utils/util.js");

var a = getApp();

Page({
    data: {
        orderId: "",
        baseUrl: a.globalData.baseUrl,
        appurl: a.globalData.urlMallOrderDetail
    },
    onLoad: function(o) {
        var t = this;
        t.setData({
            nickName: a.globalData.nickName,
            avatarUrl: a.globalData.avatarUrl,
            orderId: o.id
        }), console.log(t.data.orderId);
        var e = a.globalData.urlBase + t.data.appurl;
        this.getinitData(e);
    },
    getinitData: function(a) {
        var o = this;
        wx.request({
            url: a,
            data: {
                orderId: o.data.orderId
            },
            method: "POST",
            header: {
                "content-type": "application/x-www-form-urlencoded"
            },
            success: function(a) {
                var t = JSON.parse(a.data);
                console.log(t), 0 != t.code ? wx.showToast({
                    title: t.msg,
                    icon: "none",
                    duration: 2e3
                }) : o.setData({
                    address: t.address,
                    good: t.goodsDetailList,
                    order: t.order,
                    store: t.store
                });
            }
        });
    },
    onReady: function() {},
    onShow: function() {},
    onHide: function() {},
    onUnload: function() {},
    onPullDownRefresh: function() {},
    onReachBottom: function() {},
    onShareAppMessage: function() {}
});